package org.jiamandan.com.strategy.enums;


import org.jiamandan.com.constant.JSYConstant;

/**
 * @version Revision 1.0.1
 * @版权：版权所有 (c) 2021
 * @author:Jmd

 * @see:
 * @创建日期：2023-03-23 14:23
 * @功能说明：
 * @begin
 * @修改记录:
 * @修改后版本 修改人        修改内容
 * @2023-03-23 14:23	         Jmd        	创建
 * @end
 */
public enum JSYEventTagEnum {

    //嘉满电-YX
    //登录认证
    CMD_1(JSYConstant.Cmd.T00001, JSYConstant.Service.CMD_JSY_T00001_SERVICE),
    CMD_3(JSYConstant.Cmd.T00003, JSYConstant.Service.CMD_JSY_T00003_SERVICE),
    CMD_4(JSYConstant.Cmd.T00004, JSYConstant.Service.CMD_JSY_T00004_SERVICE),
    CMD_A6(JSYConstant.Cmd.T00NA6, JSYConstant.Service.CMD_JSY_T00NA6_SERVICE),

    CMD_201(JSYConstant.Cmd.T00201, JSYConstant.Service.CMD_JSY_T00201_SERVICE),
    CMD_202(JSYConstant.Cmd.T00202, JSYConstant.Service.CMD_JSY_T00202_SERVICE),
    CMD_203(JSYConstant.Cmd.T00203, JSYConstant.Service.CMD_JSY_T00203_SERVICE),
    CMD_204(JSYConstant.Cmd.T00204, JSYConstant.Service.CMD_JSY_T00204_SERVICE),
    CMD_205(JSYConstant.Cmd.T00205, JSYConstant.Service.CMD_JSY_T00205_SERVICE),
    CMD_301(JSYConstant.Cmd.T00301, JSYConstant.Service.CMD_JSY_T00301_SERVICE);


    private String key;

    private String value;

    JSYEventTagEnum(String key, String index) {
        this.key = key;
        this.value = index;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    //通过key-获取value
    public static String getValueByKey(String key) {
        for (JSYEventTagEnum contextEnum : JSYEventTagEnum.values()) {
            if (key.equals(contextEnum.key)) {
                return contextEnum.getValue();
            }
        }
        return "";
    }

    //通过vale-获取key
    public static String getKeyByValue(String value) {
        for (JSYEventTagEnum contextEnum : JSYEventTagEnum.values()) {
            if (value.equals(contextEnum.value)) {
                return contextEnum.getKey();
            }
        }
        return "0";
    }
}
